experimentalhighschoolmathroadmapfandomcom-20200214-history
Binary Operations
Binary Basics Binary is a base-2 number system. It is used frequently in the design of digital systems and a variety of other electronics. As a Base-2 system, there are only two possible values: 0 and 1. Values are written as a combination of 0s and 1s. For example, "2" is written as "10" in Binary, and "5" is written as "101." To avoid confusion with base-10 numbers, Binary numbers are usually denoted with the letter b''' as a prefix or suffix, such "0b101." Place Value Each place value is a power of 2. In other words, while place values in our base-10 counting system are read as: : _____ _____ _____ _____ _____ '''. 0''' : Ten Thousands-Thousands-Hundreds-Tens-Ones In Binary they would be read as: : _____ _____ _____ _____ _____ '''. 0 : Sixteen-Eights-Fours-Twos-Ones Therefore, the number "10" is 1 x Twos and 0 x Ones, or 1x2 + 0x1 = 2. Some more examples: : "101" = 1x4 + 0x2 + 1x1 = 4 + 1 = 5 : "10110" = 1x16 + 0x8 + 1x4 + 1x2 + 0x1 = 16 + 4 + 2 = 22 : "11001001" = 1x128 + 1x64 + 0x32 + 0x16 + 1x8 + 0x4 + 0x2 + 1x1 = 128 + 64 + 8 + 1 = 201 Counting The first 20 numbers in Binary are below: Every number can only be represented one unique way in binary. Operations Addition Addition in binary follows these simple rules: : 0 + 0 = 0 : 0 + 1 = 1 : 1 + 0 = 1 : 1 + 1 = 10 Following these rules: : 10001 + 11 10100 : (To check, 0b10001 = 17, 0b11 = 3; 17 + 3 = 20; 20 = 0b10100) Addition in Binary is commutative and associative. Subtraction Subtraction follows similar rules: : 0 - 0 = 0 : 1 - 0 = 1 : 1 - 0 = 0 : 10 - 1 = 1 Please note that "0 - 1" is a special case, and will be dealt with in another section. Following these rules: : 11111 - 1001 10110 : (To check, 0b11111 = 31, 0b1011 = 9; 31 - 9 = 22; 22 = 0b10110) Multiplication As Multiplication is simply repeated addition, it follows similar rules: : 0 x 0 = 0 : 1 x 0 = 0 : 0 x 1 = 0 : 1 x 1 = 1 Following these rules: : 1011 x 11 1011 + 10110 100001 : (To check, 0b1011 = 11, 0b11 = 3; 11 x 3 = 33; 33 = 0b100001) Division Binary division follows the same steps as decimal division, and involves the knowlege of binary substraction and binary multiplication. For computing 1101/101 in binary: 10 101 )1101 -101 11 quotient = 10 and remainder = 11 (to check: 1101 in binary = 13 in decimal; 101 in binary = 5 in decimal; 13 ÷ 5 = 2 (same as 10 in binary) and remainder is 3 (same as 11 in binary). Category:Binary Category:Operations Category:Homework Examples